Skip to content
This repository was archived by the owner on Dec 19, 2019. It is now read-only.

Fixed return value for getGraphQlClient in API-functional tests#127

Merged
magento-engcom-team merged 4 commits into2.3-developfrom
test-abstract-return-fix
Aug 16, 2018
Merged

Fixed return value for getGraphQlClient in API-functional tests#127
magento-engcom-team merged 4 commits into2.3-developfrom
test-abstract-return-fix

Conversation

@rogyar
Copy link
Copy Markdown
Contributor

@rogyar rogyar commented Jul 20, 2018

Description

\Magento\TestFramework\TestCase\GraphQlAbstract::getGraphQlClient is supposed to return \Magento\TestFramework\TestCase\GraphQl\Client. However, if graphQlClient was initialized previously, the method returns nothing.
The fix adjusts the return behavior. So getGraphQlClient always returns correct value.

Fixed Issues (if relevant)

N/A

Manual testing scenarios

N/A

} else {
$this->graphQlClient;
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like logic should be

if ($this->graphQlClient === null) {
             $this->graphQlClient = Bootstrap::getObjectManager()->get(\Magento\TestFramework\TestCase\GraphQl\Client::class);
}
return $this->graphQlClient;

@rogyar
Copy link
Copy Markdown
Contributor Author

rogyar commented Jul 24, 2018

Hi @naydav. Thank you for your review. I've added the mentioned changes

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants